#mount drive
from google.colab import drive
drive.mount('/content/drive')
Go to this URL in a browser: https://accounts.google.com/o/oauth2/auth?client_id=947318989803-6bn6qk8qdgf4n4g3pfee6491hc0brc4i.apps.googleusercontent.com&redirect_uri=urn%3aietf%3awg%3aoauth%3a2.0%3aoob&scope=email%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdocs.test%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive%20https%3a%2f%2fwww.googleapis.com%2fauth%2fdrive.photos.readonly%20https%3a%2f%2fwww.googleapis.com%2fauth%2fpeopleapi.readonly&response_type=code Enter your authorization code: ·········· Mounted at /content/drive
#install requirements
!pip install keras==2.3.1
!pip install tensorflow-gpu==2.1
Collecting keras==2.3.1
Downloading https://files.pythonhosted.org/packages/ad/fd/6bfe87920d7f4fd475acd28500a42482b6b84479832bdc0fe9e589a60ceb/Keras-2.3.1-py2.py3-none-any.whl (377kB)
|████████████████████████████████| 378kB 3.3MB/s
Collecting keras-applications>=1.0.6
Downloading https://files.pythonhosted.org/packages/71/e3/19762fdfc62877ae9102edf6342d71b28fbfd9dea3d2f96a882ce099b03f/Keras_Applications-1.0.8-py3-none-any.whl (50kB)
|████████████████████████████████| 51kB 4.7MB/s
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (1.15.0)
Requirement already satisfied: numpy>=1.9.1 in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (1.18.5)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (3.13)
Requirement already satisfied: scipy>=0.14 in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (1.4.1)
Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (2.10.0)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from keras==2.3.1) (1.1.2)
Installing collected packages: keras-applications, keras
Found existing installation: Keras 2.4.3
Uninstalling Keras-2.4.3:
Successfully uninstalled Keras-2.4.3
Successfully installed keras-2.3.1 keras-applications-1.0.8
Collecting tensorflow-gpu==2.1
Downloading https://files.pythonhosted.org/packages/0a/93/c7bca39b23aae45cd2e85ad3871c81eccc63b9c5276e926511e2e5b0879d/tensorflow_gpu-2.1.0-cp36-cp36m-manylinux2010_x86_64.whl (421.8MB)
|████████████████████████████████| 421.8MB 26kB/s
Requirement already satisfied: protobuf>=3.8.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (3.12.4)
Collecting tensorflow-estimator<2.2.0,>=2.1.0rc0
Downloading https://files.pythonhosted.org/packages/18/90/b77c328a1304437ab1310b463e533fa7689f4bfc41549593056d812fab8e/tensorflow_estimator-2.1.0-py2.py3-none-any.whl (448kB)
|████████████████████████████████| 450kB 28.9MB/s
Requirement already satisfied: astor>=0.6.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (0.8.1)
Requirement already satisfied: keras-applications>=1.0.8 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.0.8)
Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.15.0)
Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (3.3.0)
Requirement already satisfied: numpy<2.0,>=1.16.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.18.5)
Requirement already satisfied: absl-py>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (0.9.0)
Requirement already satisfied: grpcio>=1.8.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.31.0)
Requirement already satisfied: google-pasta>=0.1.6 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (0.2.0)
Requirement already satisfied: keras-preprocessing>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.1.2)
Collecting gast==0.2.2
Downloading https://files.pythonhosted.org/packages/4e/35/11749bf99b2d4e3cceb4d55ca22590b0d7c2c62b9de38ac4a4a7f4687421/gast-0.2.2.tar.gz
Requirement already satisfied: wrapt>=1.11.1 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.12.1)
Requirement already satisfied: wheel>=0.26; python_version >= "3" in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (0.34.2)
Requirement already satisfied: scipy==1.4.1; python_version >= "3" in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.4.1)
Collecting tensorboard<2.2.0,>=2.1.0
Downloading https://files.pythonhosted.org/packages/d9/41/bbf49b61370e4f4d245d4c6051dfb6db80cec672605c91b1652ac8cc3d38/tensorboard-2.1.1-py3-none-any.whl (3.8MB)
|████████████████████████████████| 3.9MB 37.6MB/s
Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.6/dist-packages (from tensorflow-gpu==2.1) (1.1.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.6/dist-packages (from protobuf>=3.8.0->tensorflow-gpu==2.1) (49.2.0)
Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras-applications>=1.0.8->tensorflow-gpu==2.1) (2.10.0)
Requirement already satisfied: google-auth-oauthlib<0.5,>=0.4.1 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (0.4.1)
Requirement already satisfied: google-auth<2,>=1.6.3 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (1.17.2)
Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (3.2.2)
Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (2.23.0)
Requirement already satisfied: werkzeug>=0.11.15 in /usr/local/lib/python3.6/dist-packages (from tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (1.0.1)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /usr/local/lib/python3.6/dist-packages (from google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (1.3.0)
Requirement already satisfied: cachetools<5.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (4.1.1)
Requirement already satisfied: rsa<5,>=3.1.4; python_version >= "3" in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (4.6)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /usr/local/lib/python3.6/dist-packages (from google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (0.2.8)
Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.6/dist-packages (from markdown>=2.6.8->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (1.7.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (1.24.3)
Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (2.10)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (2020.6.20)
Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.6/dist-packages (from requests<3,>=2.21.0->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (3.0.4)
Requirement already satisfied: oauthlib>=3.0.0 in /usr/local/lib/python3.6/dist-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<0.5,>=0.4.1->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (3.1.0)
Requirement already satisfied: pyasn1>=0.1.3 in /usr/local/lib/python3.6/dist-packages (from rsa<5,>=3.1.4; python_version >= "3"->google-auth<2,>=1.6.3->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (0.4.8)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.6/dist-packages (from importlib-metadata; python_version < "3.8"->markdown>=2.6.8->tensorboard<2.2.0,>=2.1.0->tensorflow-gpu==2.1) (3.1.0)
Building wheels for collected packages: gast
Building wheel for gast (setup.py) ... done
Created wheel for gast: filename=gast-0.2.2-cp36-none-any.whl size=7540 sha256=a1cec1a118c5e0e473c073b1c08cc529b353ad798ea9fa7dda28a5684e286acb
Stored in directory: /root/.cache/pip/wheels/5c/2e/7e/a1d4d4fcebe6c381f378ce7743a3ced3699feb89bcfbdadadd
Successfully built gast
ERROR: tensorflow 2.3.0 has requirement gast==0.3.3, but you'll have gast 0.2.2 which is incompatible.
ERROR: tensorflow 2.3.0 has requirement tensorboard<3,>=2.3.0, but you'll have tensorboard 2.1.1 which is incompatible.
ERROR: tensorflow 2.3.0 has requirement tensorflow-estimator<2.4.0,>=2.3.0, but you'll have tensorflow-estimator 2.1.0 which is incompatible.
ERROR: tensorflow-probability 0.11.0 has requirement gast>=0.3.2, but you'll have gast 0.2.2 which is incompatible.
Installing collected packages: tensorflow-estimator, gast, tensorboard, tensorflow-gpu
Found existing installation: tensorflow-estimator 2.3.0
Uninstalling tensorflow-estimator-2.3.0:
Successfully uninstalled tensorflow-estimator-2.3.0
Found existing installation: gast 0.3.3
Uninstalling gast-0.3.3:
Successfully uninstalled gast-0.3.3
Found existing installation: tensorboard 2.3.0
Uninstalling tensorboard-2.3.0:
Successfully uninstalled tensorboard-2.3.0
Successfully installed gast-0.2.2 tensorboard-2.1.1 tensorflow-estimator-2.1.0 tensorflow-gpu-2.1.0
#clone original maskrcnn repo
!git clone https://github.com/matterport/Mask_RCNN.git
Cloning into 'Mask_RCNN'... remote: Enumerating objects: 956, done. remote: Total 956 (delta 0), reused 0 (delta 0), pack-reused 956 Receiving objects: 100% (956/956), 116.77 MiB | 31.38 MiB/s, done. Resolving deltas: 100% (564/564), done.
The followinf files are to be edited with the corresponding .py files in the drive to allow tensorflow 2.1 work well.
--Original model was trained with tensorflow 1.13
callbacks.py, model.py and utils.py file
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/keras/callbacks.py #> line 1532
/content/Mask_RCNN/mrcnn/utils.py
/content/Mask_RCNN/mrcnn/model.py
import os
import sys
import json
import numpy as np
import time
from PIL import Image, ImageDraw
%cd Mask_RCNN/
#!pip install -r requirements.txt
!python setup.py clean --all install
/content/Mask_RCNN WARNING:root:Fail load requirements file, so using default ones. running clean 'build/lib' does not exist -- can't clean it 'build/bdist.linux-x86_64' does not exist -- can't clean it 'build/scripts-3.6' does not exist -- can't clean it running install running bdist_egg running egg_info creating mask_rcnn.egg-info writing mask_rcnn.egg-info/PKG-INFO writing dependency_links to mask_rcnn.egg-info/dependency_links.txt writing top-level names to mask_rcnn.egg-info/top_level.txt writing manifest file 'mask_rcnn.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' writing manifest file 'mask_rcnn.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py creating build creating build/lib creating build/lib/mrcnn copying mrcnn/utils.py -> build/lib/mrcnn copying mrcnn/config.py -> build/lib/mrcnn copying mrcnn/visualize.py -> build/lib/mrcnn copying mrcnn/model.py -> build/lib/mrcnn copying mrcnn/parallel_model.py -> build/lib/mrcnn copying mrcnn/__init__.py -> build/lib/mrcnn creating build/bdist.linux-x86_64 creating build/bdist.linux-x86_64/egg creating build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/utils.py -> build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/config.py -> build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/visualize.py -> build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/model.py -> build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/parallel_model.py -> build/bdist.linux-x86_64/egg/mrcnn copying build/lib/mrcnn/__init__.py -> build/bdist.linux-x86_64/egg/mrcnn byte-compiling build/bdist.linux-x86_64/egg/mrcnn/utils.py to utils.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/mrcnn/config.py to config.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/mrcnn/visualize.py to visualize.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/mrcnn/model.py to model.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/mrcnn/parallel_model.py to parallel_model.cpython-36.pyc byte-compiling build/bdist.linux-x86_64/egg/mrcnn/__init__.py to __init__.cpython-36.pyc creating build/bdist.linux-x86_64/egg/EGG-INFO copying mask_rcnn.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO copying mask_rcnn.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying mask_rcnn.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO copying mask_rcnn.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO zip_safe flag not set; analyzing archive contents... creating dist creating 'dist/mask_rcnn-2.1-py3.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it removing 'build/bdist.linux-x86_64/egg' (and everything under it) Processing mask_rcnn-2.1-py3.6.egg Copying mask_rcnn-2.1-py3.6.egg to /usr/local/lib/python3.6/dist-packages Adding mask-rcnn 2.1 to easy-install.pth file Installed /usr/local/lib/python3.6/dist-packages/mask_rcnn-2.1-py3.6.egg Processing dependencies for mask-rcnn==2.1 Finished processing dependencies for mask-rcnn==2.1
from mrcnn.config import Config
import mrcnn.utils as utils
from mrcnn import visualize
import mrcnn.model as modellib
Using TensorFlow backend.
This will default to sub-directories in your mask_rcnn_dir, but if you want them somewhere else, updated it here.
It will also download the pre-trained coco model.
ROOT_DIR = '../Mask_RCNN/'
# Directory to save logs and trained model
MODEL_DIR = os.path.join(ROOT_DIR, "logs")
# Local path to trained weights file
COCO_MODEL_PATH = os.path.join(ROOT_DIR, "/content/drive/My Drive/Team Health matrix Dataset/coco dataset/rcnn tweaked files/model weights/mask_rcnn_foodmodel_0030.h5")
# Download COCO trained weights from Releases if needed
if not os.path.exists(COCO_MODEL_PATH):
utils.download_trained_weights(COCO_MODEL_PATH)
Define configurations for training on the Food dataset.
These are settings that worked on my machine (GTX 970 graphics card). If you are getting OOM (Out of Memory) errors, you may need to tweak the settings or your computer may not be powerful enough. If you have a better graphics card, you will want to tweak it to take advantage of that.
class FoodModelConfig(Config):
"""Configuration for training on the cigarette butts dataset.
Derives from the base Config class and overrides values specific
to the cigarette butts dataset.
"""
# Give the configuration a recognizable name
NAME = "foodmodel"
# Train on 1 GPU and 1 image per GPU. Batch size is 1 (GPUs * images/GPU).
GPU_COUNT = 1
IMAGES_PER_GPU = 1
# Number of classes (including background)
NUM_CLASSES = 1 + 5 # background + 1 (classes of food)
# All of our training images are 512x512
IMAGE_MIN_DIM = 512
IMAGE_MAX_DIM = 512
# You can experiment with this number to see if it improves training
STEPS_PER_EPOCH = 500
# This is how often validation is run. If you are using too much hard drive space
# on saved models (in the MODEL_DIR), try making this value larger.
VALIDATION_STEPS = 5
# Matterport originally used resnet101, but I downsized to fit it on my graphics card
BACKBONE = 'resnet50'
# To be honest, I haven't taken the time to figure out what these do
RPN_ANCHOR_SCALES = (8, 16, 32, 64, 128)
TRAIN_ROIS_PER_IMAGE = 32
MAX_GT_INSTANCES = 50
POST_NMS_ROIS_INFERENCE = 500
POST_NMS_ROIS_TRAINING = 1000
config = FoodModelConfig()
config.display()
Configurations:
BACKBONE resnet50
BACKBONE_STRIDES [4, 8, 16, 32, 64]
BATCH_SIZE 1
BBOX_STD_DEV [0.1 0.1 0.2 0.2]
COMPUTE_BACKBONE_SHAPE None
DETECTION_MAX_INSTANCES 100
DETECTION_MIN_CONFIDENCE 0.7
DETECTION_NMS_THRESHOLD 0.3
FPN_CLASSIF_FC_LAYERS_SIZE 1024
GPU_COUNT 1
GRADIENT_CLIP_NORM 5.0
IMAGES_PER_GPU 1
IMAGE_CHANNEL_COUNT 3
IMAGE_MAX_DIM 512
IMAGE_META_SIZE 18
IMAGE_MIN_DIM 512
IMAGE_MIN_SCALE 0
IMAGE_RESIZE_MODE square
IMAGE_SHAPE [512 512 3]
LEARNING_MOMENTUM 0.9
LEARNING_RATE 0.001
LOSS_WEIGHTS {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE 14
MASK_SHAPE [28, 28]
MAX_GT_INSTANCES 50
MEAN_PIXEL [123.7 116.8 103.9]
MINI_MASK_SHAPE (56, 56)
NAME foodmodel
NUM_CLASSES 6
POOL_SIZE 7
POST_NMS_ROIS_INFERENCE 500
POST_NMS_ROIS_TRAINING 1000
PRE_NMS_LIMIT 6000
ROI_POSITIVE_RATIO 0.33
RPN_ANCHOR_RATIOS [0.5, 1, 2]
RPN_ANCHOR_SCALES (8, 16, 32, 64, 128)
RPN_ANCHOR_STRIDE 1
RPN_BBOX_STD_DEV [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD 0.7
RPN_TRAIN_ANCHORS_PER_IMAGE 256
STEPS_PER_EPOCH 500
TOP_DOWN_PYRAMID_SIZE 256
TRAIN_BN False
TRAIN_ROIS_PER_IMAGE 32
USE_MINI_MASK True
USE_RPN_ROIS True
VALIDATION_STEPS 5
WEIGHT_DECAY 0.0001
I've attempted to make this generic to any COCO-like dataset. That means if you have another dataset defined in the COCO format, it should work.
class CocoLikeDataset(utils.Dataset):
""" Generates a COCO-like dataset, i.e. an image dataset annotated in the style of the COCO dataset.
See http://cocodataset.org/#home for more information.
"""
def load_data(self, annotation_json, images_dir):
""" Load the coco-like dataset from json
Args:
annotation_json: The path to the coco annotations json file
images_dir: The directory holding the images referred to by the json file
"""
# Load json from file
json_file = open(annotation_json)
coco_json = json.load(json_file)
json_file.close()
# Add the class names using the base method from utils.Dataset
source_name = "coco_like"
for category in coco_json['categories']:
class_id = category['id']
class_name = category['name']
if class_id < 1:
print('Error: Class id for "{}" cannot be less than one. (0 is reserved for the background)'.format(class_name))
return
self.add_class(source_name, class_id, class_name)
# Get all annotations
annotations = {}
for annotation in coco_json['annotations']:
image_id = annotation['image_id']
if image_id not in annotations:
annotations[image_id] = []
annotations[image_id].append(annotation)
# Get all images and add them to the dataset
seen_images = {}
for image in coco_json['images']:
image_id = image['id']
if image_id in seen_images:
print("Warning: Skipping duplicate image id: {}".format(image))
else:
seen_images[image_id] = image
try:
image_file_name = image['id']+str('.jpeg') #image['file_name']
image_width = image['width']
image_height = image['height']
except KeyError as key:
print("Warning: Skipping image (id: {}) with missing key: {}".format(image_id, key))
image_path = os.path.abspath(os.path.join(images_dir, image_file_name))
image_annotations = annotations[image_id]
# Add the image using the base method from utils.Dataset
self.add_image(
source=source_name,
image_id=image_id,
path=image_path,
width=image_width,
height=image_height,
annotations=image_annotations
)
def load_mask(self, image_id):
""" Load instance masks for the given image.
MaskRCNN expects masks in the form of a bitmap [height, width, instances].
Args:
image_id: The id of the image to load masks for
Returns:
masks: A bool array of shape [height, width, instance count] with
one mask per instance.
class_ids: a 1D array of class IDs of the instance masks.
"""
image_info = self.image_info[image_id]
annotations = image_info['annotations']
instance_masks = []
class_ids = []
for annotation in annotations:
class_id = annotation['category_id']
mask = Image.new('1', (image_info['width'], image_info['height']))
mask_draw = ImageDraw.ImageDraw(mask, '1')
for segmentation in annotation['segmentation']:
mask_draw.polygon(segmentation, fill=1)
bool_array = np.array(mask) > 0
instance_masks.append(bool_array)
class_ids.append(class_id)
mask = np.dstack(instance_masks)
class_ids = np.array(class_ids, dtype=np.int32)
return mask, class_ids
Make sure you download the training dataset linked at the top of this notebook. If you put the dataset somewhere else, update the paths below.
dataset_train = CocoLikeDataset()
dataset_train.load_data('/content/drive/My Drive/Team Health matrix Dataset/coco dataset/train.json',
'/content/drive/My Drive/Team Health matrix Dataset/coco dataset/train')
dataset_train.prepare()
dataset_val = CocoLikeDataset()
dataset_val.load_data('/content/drive/My Drive/Team Health matrix Dataset/coco dataset/test.json',
'/content/drive/My Drive/Team Health matrix Dataset/coco dataset/test')
dataset_val.prepare()
dataset = dataset_train
dataset.class_names = ['BG', 'Chicken', 'Eba', 'Fish', 'Rice', 'Bread' ]
image_ids = np.random.choice(dataset.image_ids, 4)
for image_id in image_ids:
image = dataset.load_image(image_id)
mask, class_ids = dataset.load_mask(image_id)
visualize.display_top_masks(image, mask, class_ids, dataset.class_names)
This code is largely borrowed from the train_shapes.ipynb notebook.
# Create model in training mode
model = modellib.MaskRCNN(mode="training", config=config,
model_dir=MODEL_DIR)
# Which weights to start with?
init_with = "coco" # imagenet, coco, or last
if init_with == "imagenet":
model.load_weights(model.get_imagenet_weights(), by_name=True)
elif init_with == "coco":
# Load weights trained on MS COCO, but skip layers that
# are different due to the different number of classes
# See README for instructions to download the COCO weights
model.load_weights(COCO_MODEL_PATH, by_name=True,
exclude=["mrcnn_class_logits", "mrcnn_bbox_fc",
"mrcnn_bbox", "mrcnn_mask"])
elif init_with == "last":
# Load the last model you trained and continue training
model.load_weights(model.find_last(), by_name=True)
Train in two stages:
Only the heads. Here we're freezing all the backbone layers and training only the randomly initialized layers (i.e. the ones that we didn't use pre-trained weights from MS COCO). To train only the head layers, pass layers='heads' to the train() function.
Fine-tune all layers. For this simple example it's not necessary, but we're including it to show the process. Simply pass layers="all to train all layers.
# Train the head branches
# Passing layers="heads" freezes all layers except the head
# layers. You can also pass a regular expression to select
# which layers to train by name pattern.
start_train = time.time()
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE,
epochs=30,
layers='heads')
end_train = time.time()
minutes = round((end_train - start_train) / 60, 2)
print(f'Training took {minutes} minutes')
Starting at epoch 0. LR=0.001
Checkpoint Path: ../Mask_RCNN/logs/foodmodel20200821T1030/mask_rcnn_foodmodel_{epoch:04d}.h5
Selecting layers to train
fpn_c5p5 (Conv2D)
fpn_c4p4 (Conv2D)
fpn_c3p3 (Conv2D)
fpn_c2p2 (Conv2D)
fpn_p5 (Conv2D)
fpn_p2 (Conv2D)
fpn_p3 (Conv2D)
fpn_p4 (Conv2D)
In model: rpn_model
rpn_conv_shared (Conv2D)
rpn_class_raw (Conv2D)
rpn_bbox_pred (Conv2D)
mrcnn_mask_conv1 (TimeDistributed)
mrcnn_mask_bn1 (TimeDistributed)
mrcnn_mask_conv2 (TimeDistributed)
mrcnn_mask_bn2 (TimeDistributed)
mrcnn_class_conv1 (TimeDistributed)
mrcnn_class_bn1 (TimeDistributed)
mrcnn_mask_conv3 (TimeDistributed)
mrcnn_mask_bn3 (TimeDistributed)
mrcnn_class_conv2 (TimeDistributed)
mrcnn_class_bn2 (TimeDistributed)
mrcnn_mask_conv4 (TimeDistributed)
mrcnn_mask_bn4 (TimeDistributed)
mrcnn_bbox_fc (TimeDistributed)
mrcnn_mask_deconv (TimeDistributed)
mrcnn_class_logits (TimeDistributed)
mrcnn_mask (TimeDistributed)
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:433: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.
"Converting sparse IndexedSlices to a dense Tensor of unknown shape. "
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:433: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.
"Converting sparse IndexedSlices to a dense Tensor of unknown shape. "
/usr/local/lib/python3.6/dist-packages/tensorflow_core/python/framework/indexed_slices.py:433: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.
"Converting sparse IndexedSlices to a dense Tensor of unknown shape. "
/usr/local/lib/python3.6/dist-packages/keras/engine/training_generator.py:49: UserWarning: Using a generator with `use_multiprocessing=True` and multiple workers may duplicate your data. Please consider using the `keras.utils.Sequence class.
UserWarning('Using a generator with `use_multiprocessing=True`'
WARNING:tensorflow:Model failed to serialize as JSON. Ignoring... can't pickle _thread.RLock objects Epoch 1/30 500/500 [==============================] - 238s 475ms/step - loss: 3.3401 - rpn_class_loss: 0.0259 - rpn_bbox_loss: 1.7154 - mrcnn_class_loss: 0.5138 - mrcnn_bbox_loss: 0.5948 - mrcnn_mask_loss: 0.4903 - val_loss: 2.7972 - val_rpn_class_loss: 0.0163 - val_rpn_bbox_loss: 1.5240 - val_mrcnn_class_loss: 0.4084 - val_mrcnn_bbox_loss: 0.3761 - val_mrcnn_mask_loss: 0.2625 Epoch 2/30 500/500 [==============================] - 225s 449ms/step - loss: 2.9510 - rpn_class_loss: 0.0145 - rpn_bbox_loss: 1.6607 - mrcnn_class_loss: 0.3977 - mrcnn_bbox_loss: 0.4666 - mrcnn_mask_loss: 0.4114 - val_loss: 2.7572 - val_rpn_class_loss: 0.0133 - val_rpn_bbox_loss: 1.8365 - val_mrcnn_class_loss: 0.3872 - val_mrcnn_bbox_loss: 0.4246 - val_mrcnn_mask_loss: 0.3665 Epoch 3/30 500/500 [==============================] - 232s 464ms/step - loss: 2.5645 - rpn_class_loss: 0.0129 - rpn_bbox_loss: 1.4155 - mrcnn_class_loss: 0.3975 - mrcnn_bbox_loss: 0.3985 - mrcnn_mask_loss: 0.3400 - val_loss: 1.9965 - val_rpn_class_loss: 0.0080 - val_rpn_bbox_loss: 1.7913 - val_mrcnn_class_loss: 0.4720 - val_mrcnn_bbox_loss: 0.5149 - val_mrcnn_mask_loss: 0.4863 Epoch 4/30 500/500 [==============================] - 231s 461ms/step - loss: 2.4041 - rpn_class_loss: 0.0132 - rpn_bbox_loss: 1.3494 - mrcnn_class_loss: 0.3591 - mrcnn_bbox_loss: 0.3457 - mrcnn_mask_loss: 0.3367 - val_loss: 2.1154 - val_rpn_class_loss: 0.0129 - val_rpn_bbox_loss: 0.8647 - val_mrcnn_class_loss: 0.5026 - val_mrcnn_bbox_loss: 0.4115 - val_mrcnn_mask_loss: 0.4131 Epoch 5/30 500/500 [==============================] - 232s 464ms/step - loss: 2.1663 - rpn_class_loss: 0.0112 - rpn_bbox_loss: 1.2133 - mrcnn_class_loss: 0.3119 - mrcnn_bbox_loss: 0.3169 - mrcnn_mask_loss: 0.3130 - val_loss: 4.6908 - val_rpn_class_loss: 0.0080 - val_rpn_bbox_loss: 1.2279 - val_mrcnn_class_loss: 0.2993 - val_mrcnn_bbox_loss: 0.2426 - val_mrcnn_mask_loss: 0.2251 Epoch 6/30 500/500 [==============================] - 233s 465ms/step - loss: 1.9640 - rpn_class_loss: 0.0114 - rpn_bbox_loss: 1.1174 - mrcnn_class_loss: 0.2828 - mrcnn_bbox_loss: 0.2701 - mrcnn_mask_loss: 0.2824 - val_loss: 2.3709 - val_rpn_class_loss: 0.0020 - val_rpn_bbox_loss: 1.5312 - val_mrcnn_class_loss: 0.3461 - val_mrcnn_bbox_loss: 0.5572 - val_mrcnn_mask_loss: 0.2846 Epoch 7/30 500/500 [==============================] - 232s 464ms/step - loss: 1.9279 - rpn_class_loss: 0.0118 - rpn_bbox_loss: 1.0837 - mrcnn_class_loss: 0.2842 - mrcnn_bbox_loss: 0.2719 - mrcnn_mask_loss: 0.2764 - val_loss: 1.9710 - val_rpn_class_loss: 0.0065 - val_rpn_bbox_loss: 1.6203 - val_mrcnn_class_loss: 0.1921 - val_mrcnn_bbox_loss: 0.4051 - val_mrcnn_mask_loss: 0.6337 Epoch 8/30 500/500 [==============================] - 232s 464ms/step - loss: 1.8026 - rpn_class_loss: 0.0113 - rpn_bbox_loss: 1.0044 - mrcnn_class_loss: 0.2664 - mrcnn_bbox_loss: 0.2515 - mrcnn_mask_loss: 0.2690 - val_loss: 0.7957 - val_rpn_class_loss: 0.0082 - val_rpn_bbox_loss: 1.4848 - val_mrcnn_class_loss: 0.1739 - val_mrcnn_bbox_loss: 0.2788 - val_mrcnn_mask_loss: 0.4617 Epoch 9/30 500/500 [==============================] - 230s 460ms/step - loss: 1.8495 - rpn_class_loss: 0.0099 - rpn_bbox_loss: 1.0386 - mrcnn_class_loss: 0.2818 - mrcnn_bbox_loss: 0.2481 - mrcnn_mask_loss: 0.2711 - val_loss: 2.8536 - val_rpn_class_loss: 0.0090 - val_rpn_bbox_loss: 1.0584 - val_mrcnn_class_loss: 0.3773 - val_mrcnn_bbox_loss: 0.1561 - val_mrcnn_mask_loss: 0.2138 Epoch 10/30 500/500 [==============================] - 227s 455ms/step - loss: 1.5895 - rpn_class_loss: 0.0097 - rpn_bbox_loss: 0.8876 - mrcnn_class_loss: 0.2384 - mrcnn_bbox_loss: 0.2068 - mrcnn_mask_loss: 0.2470 - val_loss: 2.6745 - val_rpn_class_loss: 0.0038 - val_rpn_bbox_loss: 1.5705 - val_mrcnn_class_loss: 0.2211 - val_mrcnn_bbox_loss: 0.3100 - val_mrcnn_mask_loss: 0.4527 Epoch 11/30 500/500 [==============================] - 231s 462ms/step - loss: 1.6178 - rpn_class_loss: 0.0098 - rpn_bbox_loss: 0.8948 - mrcnn_class_loss: 0.2308 - mrcnn_bbox_loss: 0.2193 - mrcnn_mask_loss: 0.2631 - val_loss: 2.0797 - val_rpn_class_loss: 0.0045 - val_rpn_bbox_loss: 0.7495 - val_mrcnn_class_loss: 0.1389 - val_mrcnn_bbox_loss: 0.1859 - val_mrcnn_mask_loss: 0.1140 Epoch 12/30 500/500 [==============================] - 229s 457ms/step - loss: 1.4646 - rpn_class_loss: 0.0103 - rpn_bbox_loss: 0.7918 - mrcnn_class_loss: 0.2302 - mrcnn_bbox_loss: 0.1972 - mrcnn_mask_loss: 0.2351 - val_loss: 1.7421 - val_rpn_class_loss: 0.0074 - val_rpn_bbox_loss: 1.1753 - val_mrcnn_class_loss: 0.1832 - val_mrcnn_bbox_loss: 0.2905 - val_mrcnn_mask_loss: 0.1427 Epoch 13/30 500/500 [==============================] - 226s 452ms/step - loss: 1.6182 - rpn_class_loss: 0.0107 - rpn_bbox_loss: 0.8970 - mrcnn_class_loss: 0.2528 - mrcnn_bbox_loss: 0.2077 - mrcnn_mask_loss: 0.2500 - val_loss: 0.4569 - val_rpn_class_loss: 0.0114 - val_rpn_bbox_loss: 0.8794 - val_mrcnn_class_loss: 0.0560 - val_mrcnn_bbox_loss: 0.1324 - val_mrcnn_mask_loss: 0.1135 Epoch 14/30 500/500 [==============================] - 225s 450ms/step - loss: 1.4830 - rpn_class_loss: 0.0097 - rpn_bbox_loss: 0.8064 - mrcnn_class_loss: 0.2255 - mrcnn_bbox_loss: 0.1971 - mrcnn_mask_loss: 0.2443 - val_loss: 2.6966 - val_rpn_class_loss: 0.0047 - val_rpn_bbox_loss: 0.8417 - val_mrcnn_class_loss: 0.3813 - val_mrcnn_bbox_loss: 0.4022 - val_mrcnn_mask_loss: 0.3904 Epoch 15/30 500/500 [==============================] - 225s 451ms/step - loss: 1.3849 - rpn_class_loss: 0.0081 - rpn_bbox_loss: 0.7630 - mrcnn_class_loss: 0.2123 - mrcnn_bbox_loss: 0.1754 - mrcnn_mask_loss: 0.2260 - val_loss: 2.8693 - val_rpn_class_loss: 0.0104 - val_rpn_bbox_loss: 1.2924 - val_mrcnn_class_loss: 0.2635 - val_mrcnn_bbox_loss: 0.3027 - val_mrcnn_mask_loss: 0.2263 Epoch 16/30 500/500 [==============================] - 226s 452ms/step - loss: 1.3766 - rpn_class_loss: 0.0085 - rpn_bbox_loss: 0.7539 - mrcnn_class_loss: 0.2049 - mrcnn_bbox_loss: 0.1780 - mrcnn_mask_loss: 0.2313 - val_loss: 0.7491 - val_rpn_class_loss: 0.0125 - val_rpn_bbox_loss: 1.0413 - val_mrcnn_class_loss: 0.3066 - val_mrcnn_bbox_loss: 0.1844 - val_mrcnn_mask_loss: 0.1377 Epoch 17/30 500/500 [==============================] - 226s 452ms/step - loss: 1.3608 - rpn_class_loss: 0.0093 - rpn_bbox_loss: 0.7532 - mrcnn_class_loss: 0.2038 - mrcnn_bbox_loss: 0.1662 - mrcnn_mask_loss: 0.2283 - val_loss: 2.8022 - val_rpn_class_loss: 0.0154 - val_rpn_bbox_loss: 3.1248 - val_mrcnn_class_loss: 0.2986 - val_mrcnn_bbox_loss: 0.6688 - val_mrcnn_mask_loss: 0.4554 Epoch 18/30 500/500 [==============================] - 230s 460ms/step - loss: 1.3894 - rpn_class_loss: 0.0085 - rpn_bbox_loss: 0.7805 - mrcnn_class_loss: 0.1919 - mrcnn_bbox_loss: 0.1771 - mrcnn_mask_loss: 0.2314 - val_loss: 1.9070 - val_rpn_class_loss: 0.0084 - val_rpn_bbox_loss: 0.8498 - val_mrcnn_class_loss: 0.1467 - val_mrcnn_bbox_loss: 0.3055 - val_mrcnn_mask_loss: 0.2078 Epoch 19/30 500/500 [==============================] - 228s 456ms/step - loss: 1.1806 - rpn_class_loss: 0.0087 - rpn_bbox_loss: 0.6426 - mrcnn_class_loss: 0.1669 - mrcnn_bbox_loss: 0.1531 - mrcnn_mask_loss: 0.2093 - val_loss: 1.7743 - val_rpn_class_loss: 0.0102 - val_rpn_bbox_loss: 1.3851 - val_mrcnn_class_loss: 0.2690 - val_mrcnn_bbox_loss: 0.3706 - val_mrcnn_mask_loss: 0.4783 Epoch 20/30 500/500 [==============================] - 228s 455ms/step - loss: 1.3762 - rpn_class_loss: 0.0087 - rpn_bbox_loss: 0.7707 - mrcnn_class_loss: 0.1874 - mrcnn_bbox_loss: 0.1769 - mrcnn_mask_loss: 0.2325 - val_loss: 1.1301 - val_rpn_class_loss: 0.0019 - val_rpn_bbox_loss: 0.6234 - val_mrcnn_class_loss: 0.1679 - val_mrcnn_bbox_loss: 0.3123 - val_mrcnn_mask_loss: 0.1511 Epoch 21/30 500/500 [==============================] - 229s 459ms/step - loss: 1.2153 - rpn_class_loss: 0.0087 - rpn_bbox_loss: 0.6722 - mrcnn_class_loss: 0.1579 - mrcnn_bbox_loss: 0.1589 - mrcnn_mask_loss: 0.2177 - val_loss: 2.1980 - val_rpn_class_loss: 0.0050 - val_rpn_bbox_loss: 1.2358 - val_mrcnn_class_loss: 0.3729 - val_mrcnn_bbox_loss: 0.2948 - val_mrcnn_mask_loss: 0.3161 Epoch 22/30 500/500 [==============================] - 224s 448ms/step - loss: 1.3022 - rpn_class_loss: 0.0090 - rpn_bbox_loss: 0.7449 - mrcnn_class_loss: 0.1830 - mrcnn_bbox_loss: 0.1519 - mrcnn_mask_loss: 0.2134 - val_loss: 1.3909 - val_rpn_class_loss: 0.0070 - val_rpn_bbox_loss: 1.1890 - val_mrcnn_class_loss: 0.2057 - val_mrcnn_bbox_loss: 0.2709 - val_mrcnn_mask_loss: 0.3504 Epoch 23/30 500/500 [==============================] - 225s 451ms/step - loss: 1.2125 - rpn_class_loss: 0.0081 - rpn_bbox_loss: 0.6636 - mrcnn_class_loss: 0.1799 - mrcnn_bbox_loss: 0.1478 - mrcnn_mask_loss: 0.2131 - val_loss: 3.0046 - val_rpn_class_loss: 0.0112 - val_rpn_bbox_loss: 1.2303 - val_mrcnn_class_loss: 0.1914 - val_mrcnn_bbox_loss: 0.2222 - val_mrcnn_mask_loss: 0.3298 Epoch 24/30 500/500 [==============================] - 224s 447ms/step - loss: 1.0926 - rpn_class_loss: 0.0080 - rpn_bbox_loss: 0.5884 - mrcnn_class_loss: 0.1567 - mrcnn_bbox_loss: 0.1365 - mrcnn_mask_loss: 0.2030 - val_loss: 1.4910 - val_rpn_class_loss: 0.0068 - val_rpn_bbox_loss: 1.2597 - val_mrcnn_class_loss: 0.1813 - val_mrcnn_bbox_loss: 0.2604 - val_mrcnn_mask_loss: 0.4620 Epoch 25/30 500/500 [==============================] - 224s 449ms/step - loss: 1.2009 - rpn_class_loss: 0.0081 - rpn_bbox_loss: 0.6582 - mrcnn_class_loss: 0.1810 - mrcnn_bbox_loss: 0.1421 - mrcnn_mask_loss: 0.2115 - val_loss: 2.0193 - val_rpn_class_loss: 0.0082 - val_rpn_bbox_loss: 0.6342 - val_mrcnn_class_loss: 0.3217 - val_mrcnn_bbox_loss: 0.2767 - val_mrcnn_mask_loss: 0.2537 Epoch 26/30 500/500 [==============================] - 223s 445ms/step - loss: 0.9572 - rpn_class_loss: 0.0071 - rpn_bbox_loss: 0.4823 - mrcnn_class_loss: 0.1587 - mrcnn_bbox_loss: 0.1160 - mrcnn_mask_loss: 0.1930 - val_loss: 1.4733 - val_rpn_class_loss: 0.0076 - val_rpn_bbox_loss: 1.1909 - val_mrcnn_class_loss: 0.2294 - val_mrcnn_bbox_loss: 0.4872 - val_mrcnn_mask_loss: 0.4060 Epoch 27/30 500/500 [==============================] - 224s 447ms/step - loss: 1.0468 - rpn_class_loss: 0.0085 - rpn_bbox_loss: 0.5665 - mrcnn_class_loss: 0.1596 - mrcnn_bbox_loss: 0.1152 - mrcnn_mask_loss: 0.1969 - val_loss: 2.7831 - val_rpn_class_loss: 0.0029 - val_rpn_bbox_loss: 1.8340 - val_mrcnn_class_loss: 0.4141 - val_mrcnn_bbox_loss: 0.4097 - val_mrcnn_mask_loss: 0.2023 Epoch 28/30 500/500 [==============================] - 224s 447ms/step - loss: 0.9660 - rpn_class_loss: 0.0078 - rpn_bbox_loss: 0.5320 - mrcnn_class_loss: 0.1385 - mrcnn_bbox_loss: 0.1085 - mrcnn_mask_loss: 0.1793 - val_loss: 0.6229 - val_rpn_class_loss: 0.0095 - val_rpn_bbox_loss: 0.7132 - val_mrcnn_class_loss: 0.2868 - val_mrcnn_bbox_loss: 0.2289 - val_mrcnn_mask_loss: 0.3829 Epoch 29/30 500/500 [==============================] - 223s 446ms/step - loss: 0.9836 - rpn_class_loss: 0.0077 - rpn_bbox_loss: 0.5151 - mrcnn_class_loss: 0.1544 - mrcnn_bbox_loss: 0.1115 - mrcnn_mask_loss: 0.1949 - val_loss: 3.4962 - val_rpn_class_loss: 0.0085 - val_rpn_bbox_loss: 0.6921 - val_mrcnn_class_loss: 0.4698 - val_mrcnn_bbox_loss: 0.3312 - val_mrcnn_mask_loss: 0.1841 Epoch 30/30 499/500 [============================>.] - ETA: 0s - loss: 1.0271 - rpn_class_loss: 0.0071 - rpn_bbox_loss: 0.5321 - mrcnn_class_loss: 0.1621 - mrcnn_bbox_loss: 0.1207 - mrcnn_mask_loss: 0.2050Training took 114.46 minutes
# Fine tune all layers
# Passing layers="all" trains all layers. You can also
# pass a regular expression to select which layers to
# train by name pattern.
start_train = time.time()
model.train(dataset_train, dataset_val,
learning_rate=config.LEARNING_RATE / 10,
epochs=8,
layers="all")
end_train = time.time()
minutes = round((end_train - start_train) / 60, 2)
print(f'Training took {minutes} minutes')
Create a new InferenceConfig, then use it to create a new model.
class InferenceConfig(FoodModelConfig):
GPU_COUNT = 1
IMAGES_PER_GPU = 1
IMAGE_MIN_DIM = 512
IMAGE_MAX_DIM = 512
DETECTION_MIN_CONFIDENCE = 0.85
inference_config = InferenceConfig()
class InferenceConfig2(FoodModelConfig):
GPU_COUNT = 1
IMAGES_PER_GPU = 1
IMAGE_MIN_DIM = 1024
IMAGE_MAX_DIM = 1024
DETECTION_MIN_CONFIDENCE = 0.85
inference_config2 = InferenceConfig2()
MODEL_DIR = "/content/drive/My Drive/Team Health matrix Dataset/coco dataset/rcnn tweaked files/model weights/mask_rcnn_foodmodel_0030.h5"
MODEL_DIR
'../Mask_RCNN/logs'
# Recreate the model in inference mode
model = modellib.MaskRCNN(mode="inference",
config=inference_config,
model_dir=MODEL_DIR)
# Recreate the model in inference mode
model2 = modellib.MaskRCNN(mode="inference",
config=inference_config2,
model_dir=MODEL_DIR)
model_path
'../Mask_RCNN/.h5 file name here'
model2.load_weights(MODEL_DIR, by_name=True)
# Get path to saved weights
# Either set a specific path or find last trained weights
model_path = os.path.join(ROOT_DIR, ".h5 file name here")
#model_path = model.find_last()
# Load trained weights (fill in path to trained weights here)
assert model_path != "", "Provide path to trained weights"
print("Loading weights from ", model_path)
model.load_weights(MODEL_DIR, by_name=True) #here
Loading weights from ../Mask_RCNN/.h5 file name here
Run model.detect() on real images.
We get some false positives, and some misses. More training images are likely needed to improve the results.
dataset_val.class_names
['BG', 'Bread', 'classifications', 'Chicken', 'Fish', 'Rice']
dataset_val.class_names = ['BG', 'Chicken', 'Eba', 'Fish', 'Rice', 'Bread' ]
import skimage
real_test_dir = '/content/drive/My Drive/Team Health matrix Dataset/coco dataset/test'
image_paths = []
for filename in os.listdir(real_test_dir):
if os.path.splitext(filename)[1].lower() in ['.png', '.jpg', '.jpeg']:
image_paths.append(os.path.join(real_test_dir, filename))
for image_path in image_paths:
img = skimage.io.imread(image_path)
img_arr = np.array(img)
results = model.detect([img_arr], verbose=1)
# r = results[0]
# visualize.display_instances(img, r['rois'], r['masks'], r['class_ids'],
# dataset_val.class_names, r['scores'], figsize=(5,5))
r = results[0]
if len(r['class_ids']) == 0:
results = model2.detect([img_arr], verbose=1)
r = results[0]
visualize.display_instances(img, r['rois'], r['masks'], r['class_ids'],
dataset_val.class_names, r['scores'], figsize=(5,5))
else:
visualize.display_instances(img, r['rois'], r['masks'], r['class_ids'],
dataset_val.class_names, r['scores'], figsize=(5,5))
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -116.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (189, 267, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -116.80000 max: 138.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (267, 188, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (426, 640, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 640.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (161, 313, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (259, 194, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -107.80000 max: 138.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -103.90000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (268, 188, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 224, 3) min: 2.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -115.80000 max: 142.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -116.80000 max: 142.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 244.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 121.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 148.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 254.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -120.70000 max: 144.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (188, 268, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (188, 268, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -120.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (192, 262, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (426, 640, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 147.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 640.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (190, 265, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -120.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 148.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32
Processing 1 images image shape: (259, 194, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (259, 194, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 146.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (198, 255, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (333, 500, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 276, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 149.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (426, 640, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 640.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (426, 640, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 130.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (384, 512, 3) min: 7.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 149.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -120.70000 max: 137.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 132.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32
Processing 1 images image shape: (226, 223, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (226, 223, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (181, 278, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (181, 278, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (218, 231, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (218, 231, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (163, 310, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -116.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -119.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 137.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (192, 263, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -115.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 144.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (144, 350, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (252, 200, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (170, 297, 3) min: 6.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (170, 297, 3) min: 6.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (512, 511, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (240, 210, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (382, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 260, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (189, 267, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 144.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (640, 640, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 640.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (195, 258, 3) min: 0.00000 max: 253.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 116.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 142.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (250, 202, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (384, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -113.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (174, 290, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 148.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (382, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 146.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -115.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (197, 256, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (119, 423, 3) min: 0.00000 max: 250.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 125.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (3072, 4608, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 135.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 4608.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (221, 228, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (186, 271, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (195, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (384, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 138.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (275, 183, 3) min: 2.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (384, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 276, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 135.20000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (202, 250, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 130.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 299, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (267, 189, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (170, 297, 3) min: 0.00000 max: 235.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 131.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (100, 100, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -107.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (185, 273, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -122.70000 max: 149.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (251, 201, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 131.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -116.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (225, 225, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 144.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (223, 226, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 254.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 126.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 299, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 131.30000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (195, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -116.80000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (222, 227, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (222, 227, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 148.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (228, 221, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (228, 221, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (512, 512, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -121.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 int64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (176, 286, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (168, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (183, 275, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (194, 259, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (183, 275, 3) min: 13.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (183, 275, 3) min: 13.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (163, 310, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (159, 318, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (159, 318, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 150.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32
Processing 1 images image shape: (225, 300, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32 Processing 1 images image shape: (275, 183, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 1024, 1024, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 1024.00000 float64 anchors shape: (1, 261888, 4) min: -0.08847 max: 1.02591 float32 *** No instances to display ***
Processing 1 images image shape: (159, 317, 3) min: 0.00000 max: 255.00000 uint8 molded_images shape: (1, 512, 512, 3) min: -123.70000 max: 151.10000 float64 image_metas shape: (1, 18) min: 0.00000 max: 512.00000 float64 anchors shape: (1, 65472, 4) min: -0.17712 max: 1.05188 float32
#new_model= tf.keras.model.load_weights(filepath=COCO_MODEL_PATH)
tflite_converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = tflite_converter.convert()
open("tf_lite_model.tflite", "wb").write(tflite_model)
COCO_MODEL_PATH
'/content/drive/My Drive/Team Health matrix Dataset/coco dataset/rcnn tweaked files/model weights/mask_rcnn_foodmodel_0030.h5'